<template>
  <div>
    <h2>子组件</h2>
    <!-- 1. 接收匿名插槽的内容 -->
    <slot />
    <div class="right">
      <slot name="right" :row="row" :col="obj" />
    </div>
    <div>
      <slot name="left" :obj="obj" />
    </div>
  </div>
</template>

<script>
import { ref } from 'vue'
export default {
  data () {
    return {
      obj: { name: '小红', age: 18 }
    }
  },
  setup () {
    const row = ref({ id: 1, name: '数据' })
    return { row }
  }
}
</script>
